﻿using System;
using System.Collections.Generic;
using System.Text;
using YmSoft.Kblog.Model;
using YmSoft.Kblog.Utility;
using System.Data;
using System.Data.SqlClient;
using YmSoft.Kblog.IDAL;
namespace YmSoft.Kblog.DAL
{
    public class LogService : ILogService
    {
        public LogService()
        {

        }
        
        public int SetLoginIP(string ip, string describe)
        {
            SqlParameter[] parms = 
            { 
                new SqlParameter("@ip",SqlDbType.NVarChar,50),
                new SqlParameter("@describe",SqlDbType.NVarChar)
            };
            parms[0].Value = ip.Trim();
            parms[1].Value = describe.Trim();
            int i = SQLHelper.ExecuteNonQuery("insert into K_Log(IP,Describe) values(@ip,@describe)", CommandType.Text, parms);
            return i;
        }
    }
}
